<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增盲盒管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-blindbox-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">盲盒名称：</label>
                <div class="col-sm-8">
                    <input name="blindboxName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">盲盒类型：</label>
                <div class="col-sm-8">
                    <select id="selectType" name="type" class="form-control m-b" th:with="type=${@dict.getType('box_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">每日盲盒限制开启数量：</label>
                <div class="col-sm-8">
                    <input name="limitNumber" class="form-control" type="number" >
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">成本价格：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="costfee" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">出售价格：</label>
                <div class="col-sm-8">
                    <input name="sellfee" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">上架数量：</label>
                <div class="col-sm-8">
                    <input name="oncount" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">盲盒状态</label>
                <div class="col-sm-8">
                    <select name="status" class="form-control m-b" th:with="type=${@dict.getType('box_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">失效天数：</label>
                <div class="col-sm-8">
                    <input name="failureTime" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "lucky/blindbox"
        $("#form-blindbox-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-blindbox-add').serialize());
            }
        }


    </script>
</body>
</html>